package com.ztk.threadbasic.callable;

public class Thread01 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            System.out.println("开始执行线程逻辑");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        thread.start();
        Thread.sleep(200);
        // 设置中断标志为true
        thread.interrupt();
        System.out.println(thread.isInterrupted());
    }
}
